﻿<?php
include_once('../../includes/metodos.php');
include_once('action.php');

connectSql();
checkUser();
isAdmin();

include_once('../cabecalho.php');

if(!empty($_POST['cmd']) && $_POST['cmd']=='edit'){
	edit(anti_injection($_POST['id']));
}
connectSql();
$query = mysql_query("SELECT * FROM econ_parceiros WHERE id=".anti_injection($_REQUEST['id']));
$row = mysql_fetch_array($query);
?>
<div style="margin:0 auto;width:900px;"><br>
<form action="edit.php" method="post" enctype="multipart/form-data">
   <div style="width:695px;margin:0 auto;">
		     <div style="float:left;">
				<label id="txt_new_colunistas">Parceiro:</label>
				<input id="input_parceiros" type="text" name="nome" value="<?php echo $row['nome'];?>"/><br/><br>
				<label id="txt_new_colunistas">Imagem:</label>
				<input id="style_img_parceiros" type="file" name="img"/>
			 </div>
		 <div style="width:210px;float:right;">
			<img src="<?php echo $row['file'];?>"/>	
			<label id="txt_parceiros">Visualiza&ccedil;&atilde;o</label><br/><br/>
	     
			<?php 
				if($row['status']==1){
					echo '<input id="txt_newradio2" type="radio" name="status" value="1" checked="checked"/><label id="txt_newradio">Ativo</label><br/>';
					echo '<input id="txt_newradio2" type="radio" name="status" value="2"/><label id="txt_newradioinativo">Inativo</label><br/>';
				}else{
					echo '<input id="txt_newradio2" type="radio" name="status" value="1"/><label id="txt_newradio">Ativo</label><br/>';
					echo '<input id="txt_newradio2" type="radio" name="status" value="2" checked="checked"/><label id="txt_newradioinativo">Inativo</label><br/>';
				}
			?>
		 </div>
     </div><br><br><br><br><br>
		    <div style="margin:0 auto;width:690px;">
				<textarea rows="" cols="" name="conteudo"><?php echo $row['conteudo'];?></textarea><br/>
				<input type="hidden" name="cmd" value="edit">
				<input type="hidden" name="id" value="<?php echo anti_injection($_REQUEST['id']);?>">
				<input id="btn_new" type="submit" value="Editar"/>
			</div>
</form>
</div>